{% extends 'sales/base.html' %}
{% load static %}

{% block content %}
<form id="add_form" method="POST" action="" novalidate>
  <div class="overview_form_block row marl justify-content-center">
    <div class="col-md-6">
      <div class="card">
        <div class="card-body">
         <div class="card-title">
          Change Password
        </div>
          <div class="row marl no-gutters">
            <div class="col-md-12">
              
              {% if not user_obj %}
              <div class="filter_col col-md-12">
                <div class="form-group">
                  <label for="exampleInputEmail1">New Password {% if change_password_form.Newpassword.field.required %}<span class="error">*</span>{% endif %}</label>
                  <input type="password" class="form-control" name="Newpassword" value="{{ request.POST.Newpassword }}" placeholder="New Password">
                </div>
                <span class="error">{{ errors.Newpassword }}</span>
              </div>
              {% endif %}
              <div class="filter_col col-md-12">
                <ul style="margin-left:0; padding-left:0;">
                  <li style="font-size: 0.9em; list-style: none;">Your password can't be too similar to your other personal information.</li>
                  <li style="font-size: 0.9em; list-style: none;">Your password must contain at least 8 characters.</li>
                  <li style="font-size: 0.9em; list-style: none;">Your password can't be a commonly used password.</li>
                  <li style="font-size: 0.9em; list-style: none;">Your password can't be entirely numeric.</li>
                </ul>
              </div>
              {% if not user_obj %}
              <div class="filter_col col-md-12">
                <div class="form-group">
                  <label for="exampleInputEmail1">Confirm New Password {% if change_password_form.confirm.field.required %}<span class="error">*</span>{% endif %}</label>
                  <input type="password" class="form-control" name="confirm" value="{{ request.POST.confirm }}" placeholder="Confirm Password">
                </div>
                <span class="error">{{ errors.confirm }}</span>
              </div>
              {% endif %}
            </div>
          </div>
          <br>
          <div class="row marl buttons_row form_btn_row text-center">
            <button class="btn btn-default save" type="submit">Change Password</button>
            <button type="button" class="btn btn-default" onclick='window.open($(this).attr("href"),target = "_self")' href="{% url 'common:profile'%}" style="background:#099CBE;color:white">Cancel</button>
            
          </div>
        </div>
      </div>
    </div>
  </div>
</form>
{% endblock content %}
